package test.aspect;

import java.lang.reflect.Method;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;


@Aspect
public class LogginAspect {

	@Around("execution(* test.aspect.TestBean.*(..))")
	public Object log(ProceedingJoinPoint pjp) throws Throwable{
		
		MethodSignature methodSignature = (MethodSignature) pjp.getSignature();
		Method method = methodSignature.getMethod();
		String region = pjp.getTarget().getClass().getSimpleName();
		System.out.println(method);
		System.out.println("Before");
		Object ret = pjp.proceed();
		
		System.out.println("return value = " + ret);
		System.out.println("After");
		return ret;
	}
}
